/*
 * @Description: 导出组件
 * @Author: Rfan
 * @Date: 2022-06-22 09:41:23
 * @LastEditTime: 2022-08-09 19:49:27
 */

import { Button, Dropdown, Menu, Space } from 'antd';
import { DownOutlined } from '@ant-design/icons';
import { useArrangementContext } from '../../../contexts/ArrangementContext';
import AutoFiling from './components/AutoFiling';
import TransferInArchive from './components/TransferInArchive';

interface IConversionOptProps {
  info: any;
}

const ConversionOpt = (props: IConversionOptProps) => {
  const { info } = props;
  const { selectFile } = useArrangementContext();

  const menu = (
    <Menu
      items={[
        {
          key: 'transfer',
          label: <TransferInArchive info={info} selectItems={selectFile} />
        },
        {
          key: 'autoFiling',
          label: <AutoFiling info={info} selectItems={selectFile} />
        }
      ]}
    />
  );

  return (
    <Dropdown overlay={menu} placement="bottom" trigger={['click']}>
      <Button>
        <Space>
          流转
          <DownOutlined />
        </Space>
      </Button>
    </Dropdown>
  );
};

export default ConversionOpt;
